package cn.xiyun.xiyuncc.Coursefallback;

import cn.xiyun.xiyuncc.feignClient.CourseFeignClient;
import cn.xiyun.xiyuncc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFallbackFactory implements FallbackFactory<CourseFeignClient> {
    @Override
    public CourseFeignClient create(Throwable cause) {
        return new CourseFeignClient() {
            @Override
            public JSONResult orderData(String ids) {
                return JSONResult.error("课程服务异常");
            }
        };
    }
}
